package com.qiandw

import java.util
import javax.annotation.PostConstruct

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer

@Configuration
class FreemarkerTaglibConfig {

  @Autowired
  var freeMarkerConfigurer: FreeMarkerConfigurer = _

  @PostConstruct
  def loadClassPathTld(): Unit ={
    val paths = new util.ArrayList[String]()
    paths.add("/META-INF/security.tld")
    freeMarkerConfigurer.getTaglibFactory.setClasspathTlds(paths)
  }

}
